package com.yuyou.tas.report.service;

import com.yuyou.tas.report.vo.resp.IsExistResp;
import com.yuyou.tas.report.vo.resp.RecordDataVo;
import com.yuyou.tas.service.api.report.entity.ExamModelReport;
import com.yuyou.tas.util.bean.LoginRedisObj;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.InputStream;
import java.util.List;


public interface IExamModelReportService {
    int deleteByPrimaryKey(Long id);

    int insert(ExamModelReport record);

    ExamModelReport selectByPrimaryKey(Long id);
    
    /**
     * 检查报告是否开放
     * @param id
     * @return
     */
    boolean checkReportUse(Long id);

    int updateByPrimaryKeySelective(ExamModelReport record);

    XSSFWorkbook saveExcel(InputStream in , Long organId) throws Exception;
    
    /**
     * 查出唯一机构班级学生模板报告
     * @param authOrganizationId
     * @param lessonClassId
     * @param studentId
     * @return
     * @throws Exception
     */
    ExamModelReport selectOne(Long authOrganizationId,Long lessonClassId,Long studentId) ;

    /**
     * 获取录分页数据：学生列表，录分记录和班级信息等
     * @param classId
     * @param modelId
     * @param organId
     * @return
     * @throws Exception
     */
    RecordDataVo getStudents(Long classId , Long modelId, Long organId) throws Exception;

    /**
     * 保存录分数据
     * @param classId
     * @param stuId
     * @param modelId
     * @param scores
     * @param organId
     */
    void record(Long classId , Long stuId , Long modelId , String[] scores , Long organId);

    /**
     * 保存缺考数据
     * @param classId
     * @param stuId
     * @param modelId
     * @param organId
     */
    void recordMiss(Long classId , Long stuId , Long modelId , Long organId);

//    XSSFWorkbook check(InputStream in , Long organId) throws Exception;


    IsExistResp isExist(Long stuId , Long examId , Long classId);

    /**
     * 学生成绩 excel
     * @param isManage
     * @param examModelActivityId
     * @param baseSchoolIds
     * @param baseTrimesterId
     * @param baseSectionIds
     * @param dataSubjectIds
     * @return
     */
    HSSFWorkbook excelStudentScore(Boolean isManage, Long authUserId, Long examModelActivityId, List<Long> baseSchoolIds, Long baseTrimesterId, List<Long> baseSectionIds, List<Long> dataSubjectIds);

    /**
     * 新学生成绩 excel
     * @param isManage
     * @param examModelActivityId
     * @param baseSchoolIds
     * @param baseTrimesterId
     * @param baseSectionIds
     * @param dataSubjectIds
     * @return
     */
    HSSFWorkbook excelStudentScoreNew(Boolean isManage, Long authUserId, List<Long> examModelActivityIds, List<Long> baseSchoolIds, Long baseTrimesterId, List<Long> baseSectionIds, List<Long> dataSubjectIds);
}